﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using GodPl.GameObjects.Creatures;

namespace GodPl.GameObjects.Creatures.Actions
{
    public class ASleep : BriyyaAction
    {
        static readonly TimeSpan minDuration = new TimeSpan(0, 0, 6);
        static readonly TimeSpan maxDuration = new TimeSpan();

        public ASleep(Briyya actor) : base(actor, null)
        {

        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (!this.Running)
            {
                return;
            }

            if(actor.Drives[DriveName.Tiredness] < 0.05)
            {
                Finish();
            }

            actor.Drives[DriveName.Tiredness] -= 5 * Briyya.TirednessRate;

        }

        protected override TimeSpan MinDuration
        {
            get { return minDuration; }
        }

        protected override TimeSpan MaxDuration
        {
            get { return maxDuration; }
        }
    }
}
